import java.util.Scanner;

//check for palindrome

//								The input array is 3 
//								Please enter atleast two numbers to check for palindrome
//
//                            ****************************************************************
//
//								The input array is 1 2 3 2 1 
//								This is a palindrome
//
//							  ****************************************************************	
//
//								The input array is 1 1 2 3 5 8 
//								This is not a palindrome


public class Assignment6 {
	public static void main(String args[]) {
		CalcAPI myapi = new CalcAPI();		
		System.out.println("Enter the number of inputs");
		Scanner s = new Scanner(System.in);
		int numOfInputs = s.nextInt();
		int[] myArray = new int[numOfInputs];
		for(int i=0;i<numOfInputs;i++) {
			System.out.println("Enter integer input #" + (i+1));
			myArray[i] = myapi.getIntInput();				
		}
		System.out.format("%nThe input array is ");
		for(int i=0;i<numOfInputs;i++) {
			System.out.print(myArray[i] + " ");			
		}
		System.out.println();
		int j=numOfInputs-1;
		boolean ispalindrome = true;
		if(numOfInputs == 1)
			System.out.println("Please enter atleast two numbers to check for palindrome");
		else {
			for(int i=0;i<numOfInputs/2;i++) {
				if(myArray[i] != myArray[j]) {
					ispalindrome = false;
					break;
				}
				j--;						
			} 
			if(ispalindrome)
				System.out.println("This is a palindrome");
			else
				System.out.println("This is not a palindrome");
		}
		
	}
}
